﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<cbelo.Helpers.PaginatedListPages<cbelo.tapalanche>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tapa Lanche
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Tapa Lanche</h2>
    <div class="highslide-gallery">

    <%  
        foreach (var item in Model) {
     %>
            <div class="photo-container" style="position:relative;width:100%;">
                <div class="photo-container1" style="width:22%;position:inherit;left:0%;height:95%;">
                  <div class="photo-top"><span></span></div>
                  <div class="photo-content"> 
                        <a href="<%: item.imagem %>" onclick="return hs.expand(this)">
	                        <img src="<%: item.imagem %>" alt="<%: item.nometapalanche %>" title="<%: item.nometapalanche %>" width="95" height="60"/>
                        </a>
                        <div class="highslide-caption">
	                        <%: item.descricao %>
                        </div>

                  </div>
                  <div class="photo-bottom"><span></span></div>
                  <div class="photo-caption"><%: item.nometapalanche %></div>
                  <div class="photo-caption-bottom"><span></span></div>
                </div>
                <div class="photo-container2" style="width:78%;position:absolute;left:24%;top:10px;height:95%;">
                    <div class="photo-text" ><%: item.descricao %></div>
                    <%= Html.ActionLink("Adicionar", "AddToCart", "ShopCart", new { id = item.idtapalanche, type = 3},"") %>
                </div>
            </div>
            <br />
    <% } %>

    </div>

    <%  if (Model.TotalPages > 1)
        { 
            if (Model.HasPreviousPage)
            { %>
              <%= Html.ActionLink("« Anterior", "TapaLancheDetails", new { page = Model.PageIndex - 1 })%>
         <% }
           else
            { %>
              « Anterior
         <% } %>

         <%for (int page = 0; page < Model.TotalPages; page++)
            {
                if (page == Model.PageIndex)
                { %>
                  <%=(page+1).ToString()%>
             <% }
            else
                { %>
                  <%= Html.ActionLink((page + 1).ToString(), "TapaLancheDetails", new { page = page })%>
             <% }
            }

                 if (Model.HasNextPage)
                { %>
                  <%= Html.ActionLink("Próximo »", "TapaLancheDetails", new { page = Model.PageIndex + 1 })%>
             <% }
           else
                { %>
                   Próximo »
             <% } %>
    <% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ProductContent" runat="server">
</asp:Content>
